<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04-列表锚点-滚动索引</title>
</head>

<body>
    https://developer.mozilla.org/zh-CN/docs/Learn/CSS/CSS_layout/Positioning
    <h1>Sticky positioning</h1>

    <dl>
        <dt>A</dt>
        <dd>Apple</dd>
        <dd>Ant</dd>
        <dd>Altimeter</dd>
        <dd>Airplane</dd>
        <dt>B</dt>
        <dd>Bird</dd>
        <dd>Buzzard</dd>
        <dd>Bee</dd>
        <dd>Banana</dd>
        <dd>Beanstalk</dd>
        <dt>C</dt>
        <dd>Calculator</dd>
        <dd>Cane</dd>
        <dd>Camera</dd>
        <dd>Camel</dd>
        <dt>D</dt>
        <dd>Duck</dd>
        <dd>Dime</dd>
        <dd>Dipstick</dd>
        <dd>Drone</dd>
        <dt>E</dt>
        <dd>Egg</dd>
        <dd>Elephant</dd>
        <dd>Egret</dd>
    </dl>

    <style>
        dl {
            height: 300px;
            overflow: auto;
        }

        dt {
            background-color: black;
            color: white;
            padding: 10px;
            position: sticky;
            top: 0;
            left: 0;
            margin: 1em 0;
        }
    </style>
</body>

</html>